import logging
import time

def get_logger():
    # 配置日志
    # 时间戳
    name = time.strftime('%Y-%m-%d %H-%M-%S', time.localtime())
    logging.basicConfig(
        level=logging.DEBUG,
        format='%(asctime)s - %(message)s',
        handlers=[
            logging.FileHandler(r'D:\专业\zhuanwu\pythoncode\PythonProject5\reports\logs/'+name+'.log', encoding='utf-8'),
            logging.StreamHandler()
        ]
    )
    return logging.getLogger(__name__)